home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 2000 #2 / Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO / products / bin / jpupdate.pl < prev    next >
Perl Script  |  2000-01-05  |  35KB  |  1,072 lines

  1. #!/usr/lab/bin/perl 
  2. # ------------------------------------------------------------
  3.  
  4. # update.pl, by Jean-Pierre Girard (jpg@corrado.sun.com)
  5. # This allows the user to edit or create the _info file
  6. # necessary for the CDware.
  7. # version 1.0, Feb, 20 1996
  8. # ------------------------------------------------------------
  9.  
  10. # Bugs and other fixes
  11.  
  12. # ------------------------------------------------------------
  13. %GifImage = (
  14. "archive", "software.gif"
  15. ,"business", "software.gif"
  16. , "cad_cae", "software.gif"
  17. , "catalogs", "software.gif"
  18. , "client_server", "software.gif"
  19. , "desktop_apps", "software.gif"
  20. , "doc_mgt", "software.gif"
  21. , "epubs", "software.gif"
  22. , "graphics_imaging", "software.gif"
  23. , "info_mgt", "software.gif"
  24. , "multimedia", "software.gif"
  25. , "networking", "software.gif"
  26. , "security", "software.gif"
  27. , "sw_eng", "software.gif"
  28. , "sys_admin", "software.gif"
  29. , "telco", "software.gif"
  30. , "training", "software.gif"
  31. , "Hardware", "hardware.gif"
  32. , "Services", "services.gif"
  33. , "internet", "software.gif"
  34. , "Sun", "sunban.gif"
  35. #, "Info", "software.gif"
  36. , "companies", "companies.gif"
  37. );
  38.  
  39. %Categories = (
  40. "archive", "Archiving, Storage Management & Backup Solutions"
  41. ,"business", "Business Solutions"
  42. , "cad_cae", "CAD/CAE"
  43. , "catalogs", "Catalogs"
  44. , "client_server", "Client/Server Solutions"
  45. , "desktop_apps", "Desktop Applications"
  46. , "doc_mgt", "Document Management"
  47. , "epubs", "Electronic Publishing"
  48. , "graphics_imaging", "Graphics and Imaging"
  49. , "info_mgt", "Information Management"
  50. , "multimedia", "Multimedia"
  51. , "networking", "Networking"
  52. , "security", "Security"
  53. , "sw_eng", "Software Engineering"
  54. , "sys_admin", "System Administration"
  55. , "telco", "Telecommunications"
  56. , "training", "Training"
  57. , "Hardware", ""
  58. , "Services", ""
  59. , "internet", "Internet"
  60. , "Sun", ""
  61. #, "Info", "Info"
  62. , "companies", ""
  63. );
  64.  
  65. ##############################################################################
  66. # PrintHtml:
  67. ##############################################################################
  68. sub PrintHtml
  69. {
  70.     local($StrHtml1, $Str, $StrHtml2) = @_;
  71.     
  72.     if ($HTML_FORMAT eq "true") {
  73.         print STDOUT $StrHtml1;
  74.     }
  75.  
  76.     print STDOUT $Str;
  77.  
  78.     if ($HTML_FORMAT eq "true") {
  79.         print STDOUT $StrHtml2;
  80.     }
  81. }
  82.  
  83. ##############################################################################
  84. # EditFile:
  85. ##############################################################################
  86. sub EditFile
  87. {
  88.     local($Line, $File) = @_;
  89.     if ($HTML_FORMAT eq "true") {
  90.         print STDOUT "<A HREF=http://localhost:7999/cgi-bin/vifile.pl?FILE=$File&LINE=$Line>Edit file: $File</A>\n<ul>";
  91.     } else {
  92.         print STDOUT "File: $File\n";
  93.     }
  94. }
  95.  
  96. ##############################################################################
  97. # CheckLinks:
  98. ##############################################################################
  99. sub CheckLinks
  100. {
  101.     &PrintHtml("<BR>", "\nChecking links1...\n", "<BR>");
  102.     $ListDir = `cd $ABS_PRODUCTS_DIR; ls`;
  103.     $ListDir =~ s/\bgui\b|\bCDware\b|\bDEV\b|\bhotjava\b|\btempjas\b|\btemp\b//g;
  104.     #$ListDir =~ s/\n+/ /g;
  105.     @dirfields = split(/\s+/, $ListDir);
  106.     foreach $Dir (@dirfields) {
  107.         if ($Dir =~ /\bCDware\b|\bDEV\b/) {
  108.             next;
  109.         }
  110.         &PrintHtml("<DD><DD>",  "\t\tTesting $Dir ...\n", "<BR>");
  111.         $ListFiles = `find "$ABS_PRODUCTS_DIR/$Dir" -name "*.html" -print`;
  112.         $ListFiles .= `find "$ABS_PRODUCTS_DIR/$Dir" -name "*.htm" -print`;
  113.         @filefields = split(/\s+/, $ListFiles);
  114.         foreach $File (@filefields) {
  115.             if ($File =~ /CDware.(frame|head).html/) {
  116.                 next;
  117.             }
  118.             #&PrintHtml("<DD><DD>",  "\t\tTesting $File ...\n", "<BR>");
  119.             if (open (HTMLFILE, $File)) {
  120.                 $lineCount = 0;
  121.                 $NewLine = <HTMLFILE>;
  122.                 while(<HTMLFILE>) {
  123.                     $lineCount++;
  124.                     chop;
  125.                     $Line = "$NewLine";
  126.                     $NewLine = $_;
  127.                     $LinePrint = $Line;
  128.                     if ($HTML_FORMAT eq "true") {
  129.                         $LinePrint =~ s/</</g;
  130.                         $LinePrint =~ s/>/>/g;
  131.                     }
  132.                     if ($Line =~ /HREF *=/i) {
  133.                         $Ref = $Line;
  134.                         $Ref =~ s/.*HREF *= *"?([^">#]*)[" >#].*/\1/i;
  135.                         if ($Ref =~ /HrefButtonArea/) {
  136.                             $Ref =~ s/.*HrefButtonArea,\d+,\d+,\d+,\d+,([^" >]*)/\1/;
  137.                         }
  138.                         #print "\t$Line\n\t->$Ref\n";
  139.                         if ($Ref eq $Line) {
  140.                             &EditFile($lineCount, $File);
  141.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. n", "</B><BR>");
  142.                             &PrintHtml("<DD>",  "\tLine: $lineCount\n\t->$Ref\n", "<BR></UL>");
  143.                         }
  144.                         if ($Line =~ /href[= ]*$/i) {
  145.                             $Ref = $NewLine;
  146.                             $Ref =~ s/[     =]*([^">#=]*).*/\1/i;
  147.                         }
  148.                         if ($Ref eq "" && $Line !~ /HREF *= *"?\#/i) {
  149.                             &EditFile($lineCount, $File);
  150.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl.\n", "</B><BR>");
  151.                             &PrintHtml("<DD>",  "\tLine: $lineCount\n\t->$Ref\n", "<BR></UL>");
  152.                         }
  153.                         if ($Ref !~ /gopher:|mailto:|ftp:|http:\/\/|req_more_info.pl/i || $Ref =~ /http:\/\/localhost/) {
  154.                             #print "->$Ref\n";
  155.                             $ShortDir = $File;
  156.                             $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  157.                             if ($Ref =~ /http:\/\/localhost/i) {
  158.                                 $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  159.                                 #print "\t\tin http:$ShortDir/$Ref from $File\n";
  160.                                 if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  161.                                     &EditFile($lineCount, $File);
  162.                                     &PrintHtml("<B>", "ERROR: Missing link: $Ref . (Line $lineCount)\n", "</B><BR></UL>");
  163.                                 }
  164.                             } elsif ($Ref =~ /file:/i) {
  165.                                 $Ref =~ s?file:///tmp/httpd/.products/(.*)$?$ABS_PRODUCTS_DIR/\1?;
  166.                                 #print "\t\tin file: $Ref from $File\n";
  167.                                 unless (-s "$Ref") {
  168.                                     &EditFile($lineCount, $File);
  169.                                     &PrintHtml("<B>", "ERROR: Missing link: $Ref . (Line $lineCount)\n", "</B><BR></UL>");
  170.                                 }
  171.                             } else {
  172.                                 #print "\t\tin else: $ShortDir/$Ref from $File\n";
  173.                                 if ($Ref !~ /^#/) {
  174.                                     unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  175.                                         &EditFile($lineCount, $File);
  176.                                         &PrintHtml("<B>", "ERROR: Missing link: $Ref . (Line = $lineCount)\n", "</B><BR></UL>");
  177.                                     }
  178.                                 }
  179.                             }
  180.                         }
  181.                         
  182.                     }
  183.                     if ($Line =~ /\*URL=/i) {
  184.                         $Ref = $Line;
  185.                         $Ref =~ s/.*\*URL=([^*">]*).*/\1/i;
  186.                         $ShortDir = $File;
  187.                         $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  188.                         if ($Ref =~ /http:\/\/localhost/i) {
  189.                             $Ref =~ s?http://localhost:7999/(.*)$?$ABS_PRODUCTS_DIR/\1?;
  190.                             #print "\t\tin http:$ShortDir/$Ref from $File\n";
  191.                             if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  192.                                 &EditFile($lineCount, $File);
  193.                                 &PrintHtml("<B>", "ERROR: Missing link in applet: $Ref . (Line $lineCount)\n", "</B><BR></UL>");
  194.                             }
  195.                         } elsif ($Ref =~ /file:/i) {
  196.                             $Ref =~ s?file:///tmp/httpd/.products/(.*)$?$ABS_PRODUCTS_DIR/\1?;
  197.                             #print "\t\tin file: $Ref from $File\n";
  198.                             unless (-s "$Ref") {
  199.                                 &EditFile($lineCount, $File);
  200.                                 &PrintHtml("<B>", "ERROR: Missing link in applet: $Ref . (Line $lineCount)\n", "</B><BR></UL>");
  201.                             }
  202.                         } else {
  203.                             #print "\t\tin else: $ShortDir/$Ref from $File\n";
  204.                             if ($Ref !~ /^#/) {
  205.                                 unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  206.                                     &EditFile($lineCount, $File);
  207.                                     &PrintHtml("<B>", "ERROR: Missing link in applet: $Ref . (Line $lineCount)\n", "</B><BR></UL>");
  208.                                 }
  209.                             }
  210.                         }
  211.                     }
  212.                     if ($Line =~ /<IMG/i) {
  213.                         $Ref = $Line;
  214.                         $Ref =~ s/.*<IMG.*SRC *= *"?([^"> ]*)[" >\n].*/\1/i;
  215.                         #print "\t$Line\n\t->$Ref\n";
  216.                         if ($Ref eq $Line) {
  217.                             &EditFile($lineCount, $File);
  218.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. \n", "</B><BR>");
  219.                             &PrintHtml("<DD>",  "\tline: $lineCount\n", "<BR></UL>");
  220.                         }
  221.                         if ($Line !~ /\bsrc\b/i) {
  222.                             $Ref = $NewLine;
  223.                             $Ref =~ s/src[     =]*([^">#=]*).*/\1/i;
  224.                         }
  225.                         if ($Line =~ /src[= ]*$/i) {
  226.                             $Ref = $NewLine;
  227.                             $Ref =~ s/[     =]*([^">#=]*).*/\1/i;
  228.                         }
  229.                         if ($Ref eq "") {
  230.                             &EditFile($lineCount, $File);
  231.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. \n", "</B><BR>");
  232.                             &PrintHtml("<DD>",  "\t$LinePrint\n", "<BR></UL>");
  233.                         }
  234.                         #print "->$Ref\n";
  235.                         $ShortDir = $File;
  236.                         $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  237.                         if ($Ref =~ /http:\/\/localhost/i) {
  238.                             $Ref =~ s?http://localhost:7999/(.*)$?$ABS_PRODUCTS_DIR/\1?;
  239.                             #print "\t\tin http:$ShortDir/$Ref from $File\n";
  240.                             if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  241.                                 &EditFile($lineCount, $File);
  242.                                 &PrintHtml("<B>", "ERROR: Missing image: $Ref. (Line $lineCount)\n", "</B><BR></UL>");
  243.                             }
  244.                         } elsif ($Ref =~ /file:/i) {
  245.                             $Ref =~ s?file:///tmp/httpd/.products/(.*)$?$ABS_PRODUCTS_DIR/\1?;
  246.                             #print "\t\tin file: $Ref from $File\n";
  247.                             unless (-s "$Ref") {
  248.                                 &EditFile($lineCount, $File);
  249.                                 &PrintHtml("<B>", "ERROR: Missing image: $Ref. (Line $lineCount)\n", "</B><BR></UL>");
  250.                             }
  251.                         } else {
  252.                             #print "\t\tin else: $ShortDir/$Ref from $File\n";
  253.                             if ($Ref !~ /^#/) {
  254.                                 unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  255.                                     &EditFile($lineCount, $File);
  256.                                     &PrintHtml("<B>", "ERROR: Missing image: $Ref. (Line $lineCount)\n", "</B><BR></UL>");
  257.                                 }
  258.                             }
  259.                         }
  260.                         
  261.                     }
  262.                     #$Line =~ tr/
  263.                 }
  264.                 close(HTMLFILE);
  265.             } else {
  266.                 &PrintHtml("<B>",  "ERROR: $File cannot be open\n", "</B><BR>");
  267.             }
  268.         }
  269.     }
  270. }
  271. ##############################################################################
  272. # CheckFiles:
  273. ##############################################################################
  274. sub CheckFiles
  275. {
  276.     $ListDir = `cd $PRODUCTS_DIR; ls`;
  277.     $ListDir =~ s/\bgui\b|\bCDware\b|\bDEV\b|\bhotjava\b|\btempjas\b|\btemp\b//g;
  278.     #$ListDir =~ s/\n+/ /g;
  279.     @filefields = split(/\s+/, $ListDir);
  280.     foreach $Dir (@filefields) {
  281.         unless (-s "$PRODUCTS_DIR/$Dir/_info") {
  282.             &PrintHtml("", "WARNING: _info file missing in $Dir\n", "<BR>");
  283.         }
  284.     }
  285.     #print $ListDir;
  286. }
  287.  
  288. ##############################################################################
  289. # InitCompInfo:
  290. ##############################################################################
  291. sub InitCompInfo
  292. {
  293.     $ListDir = `ls $PRODUCTS_DIR/*/_info`;
  294.     #print "ls $PRODUCTS_DIR/*/_info";
  295.  
  296.     @filefields = split(/\s+/, $ListDir);
  297.     #print $filefields;
  298.     foreach $INFOFILENAME (@filefields) {
  299.         $ShortDir = $INFOFILENAME;
  300.         $ShortDir =~ s?.*/([^/]*)/_info$?\1?;
  301.         if (-s $INFOFILENAME && open (INFOFILE, $INFOFILENAME)) {
  302.             if ($REPORT ne "true") {
  303.                 #&PrintHtml("<DD><DD>", "\t\tReading $INFOFILENAME\n", "<BR>");
  304.             }
  305.     
  306.                     while (<INFOFILE>) {
  307.                         $Line = $_;
  308.                 unless ($Line =~ /^[     ]*$/ || $Line =~ /^#/) {
  309.                     last;
  310.                 }
  311.             }
  312.                     ($Companies{$ShortDir}, $Description{$ShortDir}, $Platform{$ShortDir}, $ChosenCat{$ShortDir}, $WebSite{$ShortDir}, $Email{$ShortDir}, $HomePageName{$ShortDir}) = split(/\^/, $Line);
  313.  
  314.             if ($CHECK eq "true") {
  315.                 $_ = $Line;
  316.                 #print "Line=$Line\n";
  317.                 $count = tr/^//;
  318.                 #print "$_: $count\n";
  319.                 if ($count != 7) {
  320.                     &PrintHtml("<B>", "ERROR: Not the correct number of parameters in the first line of $INFOFILENAME\n", "<BR>");
  321.                 }
  322.                 if ($Platform{$ShortDir} =~ /demo|testdrive|install/ && ! -d "$PRODUCTS_DIR/$ShortDir/_install") {
  323.                     &PrintHtml("<B>", "ERROR: Missing _install directory in $ShortDir\n", "<BR>");
  324.                 }
  325.                 if ($HomePageName{$ShortDir} eq "") {
  326.                     &PrintHtml("<B>", "ERROR: Missing Home page name in $ShortDir\n", "<BR>");
  327.                 } else {
  328.                     unless (-s "$PRODUCTS_DIR/$ShortDir/$HomePageName{$ShortDir}") {
  329.                         &PrintHtml("<B>", "ERROR: $HomePageName{$ShortDir} file missing in $ShortDir\n", "<BR>");
  330.                     }
  331.                 }
  332.             }
  333.             $ProdNum = 1;
  334.                     while (<INFOFILE>) {
  335.                 if ($_ =~ /^[     ]*$/ || $_ =~ /^#/) {
  336.                     next;
  337.                 }
  338.                 if ($CHECK eq "true") {
  339.                     unless ($_ =~ /^.*[^     ].*\^$/) {
  340.                         chop($_);
  341.                         &PrintHtml("<B>", "ERROR: Wrong line in $INFOFILENAME: \"$_\"\n", "<BR>");
  342.                     }
  343.                 }
  344.                             $Product=$_;
  345.                             chop($Product);
  346.                             chop($Product);
  347.                             $Products{$ShortDir . $ProdNum} = $Product;
  348.                 #print "jp = $Product\n";
  349.                 $ProdNum++;
  350.                     }
  351.             close(INFOFILE);
  352.             } else {
  353.                     &PrintHtml("", "Can't open $INFOFILENAME\n", "<BR>");
  354.         }
  355.     }
  356.     #foreach $ShortDir (sort keys(%Companies)) {
  357.         #print "$Companies{$ShortDir}, $Description{$ShortDir}, $Platform{$ShortDir}, $ChosenCat{$ShortDir}, $WebSite{$ShortDir}, $Email{$ShortDir}, $HomePageName{$ShortDir}\n";
  358.     #}
  359.     #%RevComp = reverse %Companies;
  360.     #if (@RevComp != @Companies) {
  361.         #print "WARNING: two directory with the same company name->possible problem!\n";
  362.     #}
  363.     %RevProd = reverse %Products;
  364.     if (@RevProd != @Products) {
  365.         &PrintHtml("", "WARNING: two products with the same name->possible problem!\n", "<BR>");
  366.     }
  367.     #print @Products;
  368.     #foreach $ShortDir (sort keys(%Products)) {
  369.         #print "$ShortDir, $Products{$ShortDir}\n";
  370.     #}
  371.     #foreach $ShortDir (sort keys(%RevProd)) {
  372.         #print "$ShortDir, $RevProd{$ShortDir}\n";
  373.     #}
  374.     #foreach $ShortDir (sort keys(%RevComp)) {
  375.         #print "$RevComp{ShortDir}\n";
  376.     #}
  377.     #print %RevComp;
  378. }
  379.  
  380. sub FilteredSort
  381. {
  382.     ($al = $a) =~ tr/A-Z/a-z/;
  383.     $al =~ s/^the //;
  384.     $al =~ s/^[     ]*//;
  385.  
  386.     ($bl = $b) =~ tr/A-Z/a-z/;
  387.     $bl =~ s/^the //;
  388.     $bl =~ s/^[     ]*//;
  389.  
  390.     $al cmp $bl;
  391. }
  392. sub FilteredSortComp
  393. {
  394.     $al = $Companies{$a};
  395.     ($al = $a) =~ tr/A-Z/a-z/;
  396.     $al =~ s/^the //;
  397.     $al =~ s/^[     ]*//;
  398.  
  399.     $bl = $Companies{$b};
  400.     ($bl = $b) =~ tr/A-Z/a-z/;
  401.     $bl =~ s/^the //;
  402.     $bl =~ s/^[     ]*//;
  403.  
  404.     #print "$al =? $bl\n";
  405.     $al cmp $bl;
  406. }
  407.  
  408. ##############################################################################
  409. # CreateSoft
  410. ##############################################################################
  411. sub CreateSoft
  412. {
  413.     &PrintHtml("<BR>", "\nCreating Software page...\n", "<BR>");
  414.     $SOFTFILENAME = "$CAT_DIR/Software.html";
  415.     $SOFTHEADFILENAME = "$CAT_DIR/Software.head.html";
  416.     if (open (SOFTFILE, "> $SOFTFILENAME") && open(SOFTHEADFILE, "> $SOFTHEADFILENAME")) {
  417.         $old = select(SOFTHEADFILE);
  418.         $~ = "SOFTWAREHEAD"; 
  419.         write SOFTHEADFILE;   
  420.         close (SOFTHEADFILE); 
  421.  
  422.         select(SOFTFILE);
  423.         $~ = "CATBEGIN";
  424.         write SOFTFILE;
  425.  
  426.         $Letter = "0";
  427.         foreach $Cat (sort FilteredSort keys(%Categories)) {
  428.             unless ($Categories{$Cat} eq "") {
  429.                 $CatAb = $Categories{$Cat};
  430.                 $CatAb =~ tr/a-z/A-Z/;
  431.                 $CatAb =~ s/^THE //;
  432.                 #print STDOUT "$CatAb, $Letter\n";
  433.                 unless ($CatAb =~ /^$Letter/) {
  434.                     $Letter = substr($CatAb, 0, 1);
  435.                     print SOFTFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  436.                     #push (@Letters, $Letter);
  437.                 }
  438.                 print SOFTFILE "<DD><a href=\"http://localhost:7999/.categories/?DEST=$Cat&SIZE=42\"><B>$Categories{$Cat}</B></a><br>\n";
  439.             }
  440.         }
  441.         $~ = "CATEND";
  442.         write SOFTFILE;
  443.  
  444.         close (SOFTFILE);
  445.         select($old);
  446.     }
  447.     &PrintHtml("<DD>", "\tSoftware.html page created.\n", "<BR>");
  448. }
  449.  
  450. ##############################################################################
  451. # CreateCat: 
  452. ##############################################################################
  453. sub CreateCat
  454. {
  455.     #system("mv $CAT_DIR/Software.html /tmp ");
  456.     #system("mv $CAT_DIR/companies.html /tmp >&/dev/null");
  457.     #system("mv $CAT_DIR/products.html /tmp >&/dev/null");
  458.     #system("rm $CAT_DIR/* >&/dev/null");
  459.     #system("mv /tmp/Software.html $CAT_DIR >&/dev/null");
  460.     #system("mv /tmp/companies.html $CAT_DIR >&/dev/null");
  461.     #system("mv /tmp/products.html $CAT_DIR >&/dev/null");
  462.  
  463.     foreach $catword  ( sort keys(%Categories)) {
  464.         #chop $catword;
  465.         &PrintHtml("<BR>", "\nCreating $catword category page ...\n", "<BR>");
  466.              $CATFILENAME = "$CAT_DIR/$catword.html";
  467.              $CATHEADFILENAME = "$CAT_DIR/$catword.head.html";
  468.         #print STDOUT "Bef open, $CATFILENAME, $CATHEADFILENAME\n";
  469.         if (open (CATFILE, "> $CATFILENAME") && open(CATHEADFILE, "> $CATHEADFILENAME")) {
  470.             $old = select(CATFILE);
  471.  
  472.             $~ = "CATBEGIN";
  473.             write CATFILE;
  474.             $Letter = "0";
  475.             @Letters = ();
  476.             #print STDOUT "Bef loop\n";
  477.             foreach $ShortName (sort FilteredSortComp keys(%Companies)) {
  478.                 $Comp = $Companies{$ShortName};
  479.                 #print STDOUT "        Comp=$Comp\n";
  480.                 #$ShortName = $RevComp{$Comp};    
  481.                 
  482.                 unless ($ChosenCat{$ShortName} =~ /$catword/ 
  483.                     || $catword eq "companies") {
  484.                     next;
  485.                 }
  486.                 $CompAb = $Comp;
  487.                 $CompAb =~ tr/a-z/A-Z/;
  488.                 $CompAb =~ s/^THE //;
  489.                 unless ($CompAb =~ /^$Letter/) {
  490.                     $Letter = substr($CompAb, 0, 1);
  491.                     print CATFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  492.                     push (@Letters, $Letter);
  493.                 }
  494.  
  495.                     #print CATFILE "     <DD><a HREF=file:///tmp/httpd/.products/$ShortName/$HomePageName{$ShortName}><B>$Comp</B></a> $Description{$ShortName}\n";
  496.                     print CATFILE "     <DD><a HREF=file:///tmp/httpd/.products/$ShortName/$FRAMEBASICNAME><B>$Comp</B></a> $Description{$ShortName}\n";
  497.                     print "<dd><b><i>", $Products{$ShortName . "1"}, "</i></b>\n" ;
  498.                 if ($Products{$ShortName . "2"} ne "") {
  499.                         print ", <b><i>", $Products{$ShortName . "2"}, "</i></b>\n" ;
  500.                 }
  501.                 if ($Products{$ShortName . "3"} ne "") {
  502.                         print ", <b><i>", $Products{$ShortName . "3"}, "</i></b>\n" ;
  503.                 }
  504.                 }
  505.          
  506.         
  507.             $~ = "CATEND";
  508.             write CATFILE;
  509.             close (CATFILE);
  510.  
  511.             select(CATHEADFILE);
  512.             $~ = "CATHEADERBEGIN";
  513.             write CATHEADFILE;
  514.  
  515.         print CATHEADFILE "<param name=img value=\"$DIR_IMAGES/$GifImage{$catword}\">\n";
  516.         if ($catword ne "companies") {
  517.             print CATHEADFILE "<param name=area1 value=\"HrefButtonArea,27,4,69,40,?DEST=companies\">\n";
  518.         } else {
  519.             print CATHEADFILE "<param name=area1 value=\"HrefButtonArea,27,4,69,40,?DEST=Services\">\n";
  520.         }
  521.         print CATHEADFILE "<param name=area2 value=\"HrefButtonArea,27,36,69,90,?DEST=products\">\n";
  522.         if ($catword ne "Hardware") {
  523.             print CATHEADFILE "<param name=area3 value=\"HrefButtonArea,96,0,69,40,?DEST=Hardware\">\n";
  524.         } else {
  525.             print CATHEADFILE "<param name=area3 value=\"HrefButtonArea,96,0,69,40,?DEST=Software\">\n";
  526.         }
  527.         if ($catword ne "Services" && $catword ne "companies") {
  528.             print CATHEADFILE "<param name=area4 value=\"HrefButtonArea,96,38,69,74,?DEST=Services\">\n";
  529.         } else {
  530.             print CATHEADFILE "<param name=area4 value=\"HrefButtonArea,96,38,69,74,?DEST=Software\">\n";
  531.         }
  532.         print CATHEADFILE "<param name=area5 value=\"HrefButtonArea,200,0,395,74,../CDware/index.netscape.html\">\n";
  533.  
  534.         $~ = "CATHEADERMIDDLE";
  535.         write CATHEADFILE;
  536.  
  537.                 #print CATHEADFILE `cat $Header{$catword}`;
  538.             unless ($Categories{$catword} eq "") {
  539.                     print CATHEADFILE "<CENTER><FONT SIZE=24>$Categories{$catword}</FONT></CENTER>";
  540.             }
  541.     
  542.             #@Letters = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  543.             if (@Letters > 1) {
  544.                 print CATHEADFILE "<CENTER><B>Go to:  ";
  545.                 foreach $letter (@Letters) {
  546.                     print CATHEADFILE "<A HREF=\"?DEST=$catword&L=$letter" . ($Categories{$catword} eq ""? "" : "&SIZE=42") . "\">$letter</A>\n";
  547.                 }
  548.             }
  549.             $~ = "CATHEADEREND";
  550.             write CATHEADFILE;
  551.             close (CATHEADFILE);
  552.      
  553.             &PrintHtml("<DD>", "\t$catword category page created.\n", "<BR>");
  554.  
  555.             select($old);
  556.         } else {
  557.             die "\nERROR: Cannot write $CATFILENAME or $CATHEADFILENAME!\nTry to be superuser!\n\n";
  558.         }
  559.     }
  560. }
  561.  
  562. ##############################################################################
  563. # CreateReport:
  564. ##############################################################################
  565. sub CreateReport
  566. {
  567.     $TotalSize = 0;
  568.     foreach $ShortName (sort FilteredSortComp keys(%Companies)) {
  569.         #$ShortName = $RevComp{$Comp};    
  570.         $Comp = $Companies{$ShortName};
  571.         &PrintHtml("<B>", "$Comp:\n", "</B><BR>");
  572.         &PrintHtml("<DD>", "\tProduct1: " . $Products{$ShortName . "1"} . "\n", "<BR>");
  573.         if ($Products{$ShortName . "2"} ne "") {
  574.             &PrintHtml("<DD>", "\tProduct2: " . $Products{$ShortName . "2"} . "\n", "<BR>");
  575.         }
  576.         if ($Products{$ShortName . "3"} ne "") {
  577.             &PrintHtml("<DD>", "\tProduct3: " . $Products{$ShortName . "3"} . "\n", "<BR>");
  578.         }
  579.         $Size = `du -ks $PRODUCTS_DIR/$ShortName`;
  580.         chop $Size;
  581.         $Size =~ s/(\d*).*/\1/;
  582.         &PrintHtml("<DD>", "\tTotal size: $Size Kb\n", "<BR>");
  583.         $TotalSize += $Size;
  584.         if ( $Platform{$ShortName} =~ /demo|testdrive|install/) {
  585.             &PrintHtml("<DD>", "\t", "");
  586.             if ($Platform{$ShortName} =~ /demo/) {
  587.                 &PrintHtml("", "Slide-show, ", "");
  588.             }
  589.             if ($Platform{$ShortName} =~ /testdrive/) {
  590.                 &PrintHtml("", "Demo version, ", "");
  591.             }
  592.             if ($Platform{$ShortName} =~ /install/) {
  593.                 &PrintHtml("", "Unlockable version, ", "");
  594.             }
  595.             &PrintHtml("", "\n", "<BR>");
  596.         }
  597.     }
  598.     &PrintHtml("<BR><BR>", "\n\nTotal size for all companies: $TotalSize Kb\n", "<BR>");
  599.     $Size = `du -ks $PRODUCTS_DIR/$ShortName`;
  600.     chop $Size;
  601.     $Size =~ s/(\d*).*/\1/;
  602.     &PrintHtml("", "Total size for .products: $Size Kb\n", "<BR>");
  603. }
  604.  
  605. ##############################################################################
  606. # CreateApplet:
  607. ##############################################################################
  608. sub CreateApplet
  609. {
  610.     &PrintHtml("", "\nBuilding Control bar applets ...\n", "<BR>");
  611.     $TmpFile = "/tmp/tmpupdateapplet";
  612.     foreach $Comp (sort keys(%Companies)) {
  613.         $FRAMEFILENAME = "$PRODUCTS_DIR/$Comp/$FRAMEBASICNAME";
  614.         if (open (FRAMEFILE, "> $FRAMEFILENAME")) {
  615.             print FRAMEFILE "<html> <head>\n<title>CDware May 1996: $Companies{$Comp}</title>\n</head>\n<FRAMESET ROWS=\"50,*\">\n<FRAME SCROLLING=\"no\" TARGET=\"_top\" NAME=\"menu\" NORESIZE SRC=\"CDware.head.html\">\n<FRAME SCROLLING=\"yes\" NAME=\"content\" NORESIZE MARGINHEIGHT=4 SRC=\"$HomePageName{$Comp}\">\n</BODY> </NOFRAME> </FRAMESET> </HTML>\n";
  616.             close(FRAMEFILE);
  617.         } else {
  618.             &PrintHtml("", "ERROR: Couldn't write $FRAMEFILENAME\n", "<BR>");
  619.         }
  620.  
  621.         $HEADFILENAME = "$PRODUCTS_DIR/$Comp/$HEADBASICNAME";
  622.         if (open (HEADFILE, "> $HEADFILENAME")) {
  623.             print HEADFILE "<html> <head>\n<title>CDware May 1996</title>\n</head>\n<BODY>\n<CENTER>\n<applet code=ImageMap.class width=596 height=36>\n<param name=highlight value=\"brighter60\">";
  624.             
  625.             $TestGif = 0;
  626.             if ($Platform{$Comp} =~ /demo/) {
  627.                 $TestGif ++;
  628.             }
  629.             if ($Platform{$Comp} =~ /testdrive/) {
  630.                 $TestGif += 2;
  631.             }
  632.             if ($Platform{$Comp} =~ /install/) {
  633.                 $TestGif += 4;
  634.             }
  635.             @BarFileNames = ("none", "rd", "td", "tdrd", "ts", "tsrd", "tdts", "samplebar");
  636.             print HEADFILE "<param name=img value=\"$PRODUCTS_DIR/CDware/images/$BarFileNames[$TestGif].gif\">\n";
  637.  
  638.             print HEADFILE "<param name=area1 value=\"HrefButtonArea,0,0,80,35,file:///tmp/httpd/.products/CDware/index.netscape.html\" >\n";
  639.             print HEADFILE "<param name=area2 value=\"HrefButtonArea,81,0,84,35,http://localhost:7999/.categories/?DEST=companies\" >\n";
  640.             print HEADFILE "<param name=area3 value=\"HrefButtonArea,164,0,83,35,file:///tmp/httpd/.products/CDware/docs/info/features.html\" >\n";
  641.             print HEADFILE "<param name=area4 value=\"HrefButtonArea,267,0,85,35,http://localhost:7999/cgi-bin/req_more_info.pl?$Comp\" >\n";
  642.  
  643.             $Area = 5;
  644.             if ($Platform{$Comp} =~ /demo/) {
  645.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,350,0,83,35,http://localhost:7999/$Comp/_install/install_show.sh\">\n";
  646.                 $Area ++;
  647.             }
  648.             if ($Platform{$Comp} =~ /testdrive/) {
  649.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,434,0,81,35,http://localhost:7999/$Comp/_install/run.sh\">\n";
  650.                 $Area ++;
  651.             }
  652.             if ($Platform{$Comp} =~ /install/) {
  653.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,515,0,83,35,http://localhost:7999/$Comp/_install/install.sh\">\n";
  654.             }
  655.             
  656.             print HEADFILE "</applet> </CENTER> </BODY> </HTML>\n";
  657.  
  658.  
  659.             close(HEADFILE);
  660.         } else {
  661.             &PrintHtml("", "ERROR: Couldn't write $HEADFILENAME\n", "<BR>");
  662.         }
  663.  
  664.              #$HOMEFILENAME = "../$Comp/" . $HomePageName{$ShortDir};
  665.         #if (open (HOMEFILE, "$HOMEFILENAME")) {
  666.             #open (TMPFILE, "$TmpFile");
  667.             #while (<TMPFILE>) {
  668.                 #$Line = $_;
  669.                 #if ($Line =~ /^<applet class=cdbar/i) {
  670.                     #while (! <HOMEFILE> =~ /^<\/applet>/i) {
  671.                     #}
  672.                     #$TestGif = 0;
  673.                     #if ($Platform{$Comp} =~ /demo/) {
  674.                         #$TestGif ++;
  675.                     #}
  676.                     #if ($Platform{$Comp} =~ /testdrive/) {
  677.                         #$TestGif ++;
  678.                     #}
  679.                     #if ($Platform{$Comp} =~ /install/) {
  680.                         #$TestGif ++;
  681.                     #}
  682.                     #print TMPFILE "<app class=CDbar img=\"../CDware/images/none.gif";
  683.                     #print TMPFILE "highlight=brighter60";
  684. ##            print "area1=HrefButtonArea,0,0,80,35,file:///tmp/httpd/.products/CDware/index.html" >> applet
  685. ##            print "area2=HrefButtonArea,81,0,84,35,file:///tmp/httpd/.products/.categories/companies.html" >> applet
  686. ##            print "area3=HrefButtonArea,164,0,83,35,file:///tmp/httpd/.products/CDware/docs/info/features.html" >> applet
  687. ##            print "area4=HrefButtonArea,267,0,85,35,file:///tmp/httpd/.products/DEV/disabled.html" >> applet
  688. ##            print ">" >> applet
  689. ##                        breaksw    
  690. ## 
  691.                     #next;
  692.                 #}
  693.                 #print TMPFILE $Line;
  694.             #}
  695.         #}
  696.         #rename($TmpFile, $HOMEFILENAME);
  697.     }
  698.     &PrintHtml("", "\tControl bar applets built...\n", "<BR>");
  699. }
  700. ###############################################################################
  701. ## CreateProduct
  702. ###############################################################################
  703. sub CreateProduct
  704. {
  705.     &PrintHtml("<BR>", "\nCreating Products page...\n", "<BR>");
  706.  
  707.          $PRODFILENAME = "$CAT_DIR/products.html";
  708.          $PRODHEADFILENAME = "$CAT_DIR/products.head.html";
  709.     if (open (PRODFILE, "> $PRODFILENAME") && open(PRODHEADFILE, "> $PRODHEADFILENAME")) {
  710.         $old = select(PRODFILE);
  711.  
  712.         $~ = "CATBEGIN";
  713.         write PRODFILE;
  714.         $Letter = "0";
  715.         @Letters = ();
  716.         foreach $Prod (sort FilteredSort keys(%RevProd)) {
  717.             $ShortName = substr($RevProd{$Prod}, 0, length($RevProd{$Prod}) - 1);    
  718.             
  719.             #print STDOUT "        Prod=$Prod, ShortName=$ShortName.\n";
  720.             $ProdAb = $Prod;
  721.             $ProdAb =~ tr/a-z/A-Z/;
  722.             $ProdAb =~ s/^THE //;
  723.             $ProdAb =~ s/^[     ]*//;
  724.             unless ($ProdAb =~ /^$Letter/) {
  725.                 $Letter = substr($ProdAb, 0, 1);
  726.                 print PRODFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  727.                 push (@Letters, $Letter);
  728.             }
  729.  
  730.                 #print PRODFILE "<DD><A HREF=file:///tmp/httpd/.products/$ShortName/$HomePageName{$ShortName}><B>$Prod</B></A> <I>from</I> <B>$Companies{$ShortName}</B>\n";
  731.                 print PRODFILE "<DD><A HREF=file:///tmp/httpd/.products/$ShortName/$FRAMEBASICNAME><B>$Prod</B></A> <I>from</I> <B>$Companies{$ShortName}</B>\n";
  732.             }
  733.      
  734.         $~ = "CATEND";
  735.         write PRODFILE;
  736.         close (PRODFILE);
  737.  
  738.         select(PRODHEADFILE);
  739.         $~ = "CATHEADERBEGIN";
  740.         write PRODHEADFILE;
  741.  
  742.         print PRODHEADFILE "<param name=img value=\"$DIR_IMAGES/products.gif\">\n";
  743.         print PRODHEADFILE "<param name=area1 value=\"HrefButtonArea,27,4,69,40,?DEST=companies\">\n";
  744.         print PRODHEADFILE "<param name=area2 value=\"HrefButtonArea,27,36,69,90,?DEST=Services\">\n";
  745.         print PRODHEADFILE "<param name=area3 value=\"HrefButtonArea,96,0,69,40,?DEST=Hardware\">\n";
  746.         print PRODHEADFILE "<param name=area4 value=\"HrefButtonArea,96,38,69,74,?DEST=Software\">\n";
  747.         print CATHEADFILE "<param name=area5 value=\"HrefButtonArea,200,0,395,74,../CDware/index.netscape.html\">\n";
  748.  
  749.         print PRODHEADFILE "</applet><br></td><tr><td>";
  750.         #$~ = "CATHEADERMIDDLE";
  751.         #write PRODHEADFILE;
  752.  
  753.             #print PRODHEADFILE `cat $Header{$catword}`;
  754.         #unless ($Categories{$catword} eq "") {
  755.                 #print PRODHEADFILE "<H1>$Categories{$catword}</H1>";
  756.         #}
  757.  
  758.         #@Letters = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  759.         print PRODHEADFILE "<B><FONT size=\"4\"> Go to:\n";
  760.         foreach $letter (@Letters) {
  761. # below changed by Marc
  762.             #print PRODHEADFILE "<A HREF=\"?DEST=$catword&L=$letter\">$letter</A>\n";
  763.             print PRODHEADFILE "<A HREF=\"?DEST=products&L=$letter\">$letter</A>\n";
  764.         }
  765.         $~ = "CATHEADEREND";
  766.         write PRODHEADFILE;
  767.         close (PRODHEADFILE);
  768.  
  769.         &PrintHtml("<DD>", "\tproducts.html page created.\n", "<BR>");
  770.  
  771.         select($old);
  772.     }
  773. }
  774. ##############################################################################
  775. # MAIN PART: Decode the parameters and calls the correct subfunctions
  776. ##############################################################################
  777. #$arg0=$0
  778. #$DIR=$arg0:h
  779. #$ProgName=$arg0:t
  780.  
  781. #if ("X$DIR" == "X$ProgName") {
  782.     #$DIR='.'
  783. #}
  784.  
  785. #if (-e "./$ProgName") {
  786.     #$DIR=$cwd
  787. #}
  788.  
  789. #cd  $DIR
  790. #print `pwd`;
  791.  
  792. #
  793. # Create the category pages seen in the categories.txt file
  794. #
  795.  
  796. #foreach $en (sort keys %ENV) {
  797.     #print "$en = $ENV{$en}\n";
  798. #}
  799.  
  800.  
  801.     $CATS = "false";
  802.     $APPLETS = "false";
  803.     $COMP = "false";
  804.     $CHECK = "false";
  805.     $REPORT = "false";
  806.     $HTML_FORMAT = "false";
  807.     $PROD = "false";
  808.     $SOFT = "false";
  809.     $PLATFORM = "sparc";
  810.  
  811.     $DIR_IMAGES = "../CDware/images/";
  812.     $PRODUCTS_DIR = "../";
  813.     $PWD = $ENV{"PWD"};
  814.     #print "PWD=$PWD, PRODUCTS_DIR=$PRODUCTS_DIR\n";
  815.     if ($PRODUCTS_DIR =~ /^\//) {
  816.         $ABS_PRODUCTS_DIR = "$PRODUCTS_DIR";
  817.     } else {
  818.         $buf = $PRODUCTS_DIR;
  819.         while ($buf =~ /^\.\.\//) {
  820.             #print "PWD=$PWD, buf=$buf\n";
  821.             $buf =~ s?^\.\./??;
  822.             $PWD =~ s?[^/]*/*$??;
  823.             #print "PWD=$PWD, buf=$buf\n";
  824.         }
  825.         $ABS_PRODUCTS_DIR = "$PWD/$buf";
  826.     }
  827.     $ABS_PRODUCTS_DIR =~ s?//?/?g;
  828.  
  829.     # parse command line arguements
  830.  
  831.     #print "Arg=@ARGV.\n";
  832.     @ARGREPORT = @ARGV;
  833.     if (@ARGV == 0) {
  834.         @ARGV=("-?");
  835.     }
  836.  
  837.         while ($ARGV[0] =~ /^-/) {
  838.             $_ = shift;
  839.             #print "Arg=$_.\n";
  840.             if (/^-cats$/) {
  841.                 $CATS = "true";
  842.             } elsif (/^-applets/) {
  843.                 $APPLETS = "true";
  844.             } elsif (/^-comp/) {
  845.                 $COMP = "true";
  846.             } elsif (/^-checkall/) {
  847.                 $CHECK = "true";
  848.                 $CHECKLINKS = "true";
  849.             } elsif (/^-checklinks/) {
  850.                 $CHECKLINKS = "true";
  851.             } elsif (/^-check/) {
  852.                 $CHECK = "true";
  853.             } elsif (/^-soft/) {
  854.                 $SOFT = "true";
  855.             } elsif (/^-report/) {
  856.                 $REPORT = "true";
  857.             } elsif (/^-html/) {
  858.                 $HTML_FORMAT = "true";
  859.             } elsif (/^-dir/) {
  860.                 $PRODUCTS_DIR = ($1 ? $1 : shift);
  861.                 unless (-s $PRODUCTS_DIR) {
  862.                     die "ERROR: $PRODUCTS_DIR is not a directory\n";
  863.                 }
  864.             } elsif (/^-prod/) {
  865.                 $PROD = "true";
  866.             } elsif (/^-all/) {
  867.                 $PROD = "true" ;
  868.                 $COMP = "true";
  869.                 $SOFT = "true";
  870.                 $APPLETS = "true";
  871.                 $CATS = "true";
  872.             } elsif (/^-x86/) {
  873.                 $PLATFORM = x86;
  874.                 $SRC_DIR = "../../../x86.image";
  875.             } elsif (/^-[?Hh]/) {
  876.                 die "Usage: update.pl [ -cats | -applets | -soft | -prod | -all | -dir dirname | -x86  | -report | -html | -check]\n\tall: = -cats -prod -applets\n\tapplets: creates an applet in the customer home page.\n\tcats: creates the category and company pages.\n\tcheck: check the _info file, and other things for errors.\n\tdir: gives the directory where the companies are located.\n\thtml: when -report is selected, creates an output in HTML format.\n\tprod: creates the product page.\n\treport: creates a report for all companies.\n\tsoft: creates the Software pages\n\tx86: for future usage.\n";
  877.             } else {
  878.                 die "Unrecognized switch: $_ (try -?)\n";
  879.             }
  880.         }
  881.  
  882. &PrintHtml("<HTML> <HEAD> <title>Developer CD - status on " . `date` . "</title> </HEAD> <BODY><H1>", "Developer CD - status on " . `date` . "\n", "</H1>");
  883.  
  884. # check if root user
  885. if ( $ENV{"USER"} ne "root" ) {
  886.         &PrintHtml("", "WARNING: This program should be run as root user.\n", "<BR>");
  887.     }
  888.  
  889.  
  890.     if ($REPORT ne "true") {
  891.         $HostName = `hostname`;
  892.         chop $HostName;
  893.         &PrintHtml("", "\nUpdating CDware on $HostName:\n\n", "<BR>");
  894.     if (open (REPORTFILE, ">> $PRODUCTS_DIR/.update.txt")) {
  895.         $Date = `date`;
  896.         chop $Date;
  897.         print REPORTFILE "update by " . $ENV{"USER"} . " on $Date from $HostName\n\tparams: ";
  898.         while (@ARGREPORT) {
  899.             print REPORTFILE "$ARGREPORT[0], ";
  900.             shift @ARGREPORT;
  901.         }
  902.         print REPORTFILE "\n\n";
  903.         close (REPORTFILE);
  904.     } else {
  905.         &PrintHtml("", "WARNING: Cannot open $PRODUCTS_DIR/.update.txt\n", "<BR>");
  906.     }
  907. }
  908.  
  909. &InitCompInfo();
  910.  
  911. $CAT_DIR = "$PRODUCTS_DIR/.categories";
  912. $FRAMEBASICNAME = "CDware.frame.html";
  913. $HEADBASICNAME = "CDware.head.html";
  914. #print $CAT_DIR;
  915. if ( ! -d $CAT_DIR ) {
  916.     mkdir($CAT_DIR, 0777);
  917. }
  918.  
  919. if ( $CHECK eq "true" ) {
  920.     &CheckFiles();
  921. }
  922.  
  923. if ( $CHECKLINKS eq "true" ) {
  924.     &CheckLinks();
  925. }
  926.  
  927. if ( $CATS eq "true" ) {
  928.     &CreateCat();
  929. }
  930.  
  931. if ( $SOFT eq "true" ) {
  932.     &CreateSoft();
  933. }
  934.  
  935. #
  936. # Get all CDware menu bar components and put in file 
  937. # for building of front page applet 
  938. #
  939. if ( $APPLETS eq "true" ) {
  940.     &CreateApplet();
  941. }
  942.  
  943. if ( $PROD eq "true" ) {
  944.     &CreateProduct();
  945. }
  946.  
  947. if ( $REPORT eq "true" ) {
  948.     &CreateReport();
  949. }
  950.  
  951. #
  952. # Compile list of companies, place in 'companies' file
  953. #
  954. #if ( $COMP eq "true" ) {
  955.     #&CreateComp();
  956. #}
  957.  
  958. #
  959. # Compile list of products, place in 'products' file
  960. #
  961.  
  962. #print "\n\n\nPress <RETURN> to close the window and test your submission..\n.";
  963. #read answer;
  964.  
  965. ################################################################################
  966. # Define FORMATS (no more code)
  967. ################################################################################
  968. format CATHEADERBEGIN =
  969. <html>
  970. <body  BGCOLOR="#8c8cde" link=#33ff00 vlink=#33ff00 >
  971. <center>
  972. <BASE TARGET="_top" HREF="http://localhost:7999/.categories/">
  973. <form method="get"  ACTION="http://localhost:7999/cgi-bin/brandnewwais.pl/wais_CDware">
  974. <table border = 9><td>
  975. <applet code=ImageMap.class width=596 height=75>
  976. <param name=highlight value="brighter60">
  977. .
  978.  
  979. format CATHEADERMIDDLE =
  980. </applet><br></td><tr><td>
  981. <B><FONT size="4">
  982. #<B>Go to:  </b>
  983. .
  984.  
  985. format CATHEADEREND =
  986. </font>
  987.  Search: <input type="text" name="isindex" size="12" >
  988. </CENTER>
  989. </td><tr></table>
  990. </form>
  991. </center>
  992. </body>
  993. </html>
  994. .
  995.  
  996. format CATBEGIN =
  997. <HTML>
  998.         <!-- header section-->
  999. <HEAD>
  1000. <title>Catalyst CDware - SPARC Edition - January through April</title>
  1001. </HEAD>
  1002.         <!-- document body-->
  1003. <BODY>
  1004. <BASE TARGET="_top">
  1005. <DL>
  1006. #<hr>
  1007. #<p>
  1008. .
  1009.  
  1010. format CATEND =
  1011. </B></B><DT>
  1012. <hr>
  1013. </BODY>
  1014. </HTML>
  1015. .
  1016.  
  1017. format SOFTWAREHEAD =
  1018. <HTML>
  1019.         <!-- header section-->
  1020. <HEAD>
  1021. <TITLE>Catalyst CDware - Software Categories</TITLE>
  1022. </HEAD>
  1023.         <!-- document body-->
  1024. <BODY BGCOLOR="8c8cde" link=#33ff00 vlink=#33ff00>
  1025. <CENTER>
  1026. <BASE TARGET="_top" HREF="http://localhost:7999/.categories/">
  1027. <form method="get"  ACTION="http://localhost:7999/cgi-bin/brandnewwais.pl/wais_CDware">
  1028. <table border = 9><td>
  1029. <applet code=ImageMap.class width=596 height=75>
  1030. <param name=highlight value="brighter60">
  1031. <param name=img value="../CDware/images/software.gif">
  1032. <param name=area1 value="HrefButtonArea,27,4,69,40,../.categories/?DEST=companies">
  1033. <param name=area2 value="HrefButtonArea,27,36,69,90,../.categories/?DEST=products">
  1034. <param name=area3 value="HrefButtonArea,96,0,69,40,../.categories/?DEST=Hardware">
  1035. <param name=area4 value="HrefButtonArea,96,38,69,74,../.categories/?DEST=Services">
  1036. <param name=area5 value="HrefButtonArea,200,0,395,74,../CDware/index.netscape.html">
  1037. </applet>
  1038. </TD><TR><TD>
  1039. <CENTER>
  1040. Search: <input type="text" name="isindex" size="12" >
  1041. </CENTER>
  1042. </td><tr></table>
  1043. </CENTER>
  1044. </form>
  1045. </BODY>
  1046. </HTML>
  1047. .
  1048. ##############################################################################
  1049. format FRAMEHEADER =
  1050. Content-type: text/html
  1051.  
  1052.  
  1053.  
  1054. <html>
  1055. <head>
  1056. <title>CDware May 1996</title>
  1057. </head>
  1058. <FRAMESET ROWS="20,80">
  1059. #$size
  1060. .
  1061. ##############################################################################
  1062. format FRAMEFOOTER =
  1063. <BODY BACKGROUND="icons/bkgrnds/homebg.gif" body bgcolor=black text=#ffffff link=#dddddd alink=#ffff00 vlink=#bbbbbb>
  1064.  
  1065. <FONT SIZE=-1>Copyright \0511995 <B><A
  1066.  
  1067. </BODY>
  1068. </NOFRAME>
  1069. </FRAMESET>
  1070. </HTML>
  1071. .
  1072.